package br.com.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;


public class AppMenu extends Activity {
	
	private boolean confirmacaoWiki = false;
	private boolean confirmacaoChat = false;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menus, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item){
		switch (item.getItemId()){
		case R.id.wiki:
			confirmacaoWiki = true;
			carregarTela2(1);
			break;
		case R.id.chat:
			confirmacaoChat = true;
			carregarTela2(2);
			break;
		}   	
		return true;

	}
	
	public boolean getConfirmacaoWiki(){
		return confirmacaoWiki;
	}
	
	public boolean getConfirmacaoChat(){
		return confirmacaoChat;
	}
	
	public void carregarTela2(int i){
	
		setContentView(R.layout.tela2);
		
		Intent it = new Intent(AppMenu.this, Tela2.class);
		it.putExtra("text", i);
		
		startActivity(it);
		
	}
	

}